// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.app.*;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.text.*;
import android.view.KeyEvent;
import android.view.View;
import android.widget.*;
import com.nnee.p_fk.cls_ActivityEx;
import com.nnee.p_img.cls_d;
import com.nnee.p_img.p_video.cls_ActivityCropImage;
import com.nnee.p_l.p_a.cls_a;
import com.nnee.p_pr.p_a.cls_p;
import com.nnee.p_pr.p_atom.p_u.cls_UserInfo;
import com.nnee.p_pr.cls_b;
import com.nnee.p_pr.cls_v;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            ei, ej, eh, ee, 
//            eg, ef

public class cls_PRISActivityUserInfoModify extends cls_ActivityEx
    implements TextWatcher, android.view.View.OnClickListener, android.widget.AdapterView.OnItemSelectedListener
{

    public cls_PRISActivityUserInfoModify()
    {
        h = null;
        q = new EditText[5];
        a = false;
        b = new ei(this);
        e = new ej(this);
        f = false;
        w = new eh(this);
    }

    static Bitmap a(PRISActivityUserInfoModify prisactivityuserinfomodify, Bitmap bitmap)
    {
        prisactivityuserinfomodify.t = bitmap;
        return bitmap;
    }

    static ImageView a(PRISActivityUserInfoModify prisactivityuserinfomodify)
    {
        return prisactivityuserinfomodify.j;
    }

    public static void a(Activity activity, int i1, cls_UserInfo userinfo, Bitmap bitmap)
    {
        Intent intent = new Intent(activity, com/netease/pris/activity/PRISActivityUserInfoModify);
        Bundle bundle = new Bundle();
        bundle.putParcelable("extra_userinfo_value", userinfo);
        bundle.putParcelable("data", bitmap);
        intent.putExtras(bundle);
        activity.startActivityForResult(intent, 1);
    }

    private void b()
    {
        setTitle(0x7f0a0126);
        findViewById(0x7f0d0008).setOnClickListener(this);
        j = (ImageView)findViewById(0x7f0d0121);
        ArrayAdapter arrayadapter;
        InputFilter ainputfilter[];
        String as[];
        if(t == null)
        {
            StringBuilder stringbuilder = new StringBuilder();
            com.nnee.p_img.cls_d.a().a(stringbuilder, 1, h.w(), new ee(this, stringbuilder), 48, 48, 1);
        } else
        {
            j.setImageBitmap(t);
        }
        k = (TextView)findViewById(0x7f0d0122);
        l = (TextView)findViewById(0x7f0d0123);
        l.setText(com.nnee.p_l.p_a.cls_a.b(this, h.g()));
        m = (TextView)findViewById(0x7f0d0124);
        m.setOnClickListener(this);
        n = (EditText)findViewById(0x7f0d0125);
        if(h.a())
        {
            k.setText(h.x());
            InputFilter ainputfilter2[] = new InputFilter[1];
            ainputfilter2[0] = new android.text.InputFilter.LengthFilter(h.h());
            n.setFilters(ainputfilter2);
            n.setText(h.x());
            n.setSelection(0);
        }
        n.addTextChangedListener(this);
        o = (Spinner)findViewById(0x7f0d0126);
        arrayadapter = new ArrayAdapter(this, 0x1090008, i);
        arrayadapter.setDropDownViewResource(0x1090009);
        o.setAdapter(arrayadapter);
        o.setVisibility(0);
        o.setPrompt(getString(0x7f0a0127));
        o.setSelection(c(com.nnee.p_l.p_a.cls_a.b(this, h.g())), false);
        p = (EditText)findViewById(0x7f0d0127);
        if(h.b())
        {
            InputFilter ainputfilter1[] = new InputFilter[1];
            ainputfilter1[0] = new android.text.InputFilter.LengthFilter(h.s());
            p.setFilters(ainputfilter1);
            p.addTextChangedListener(this);
        }
        p.setText(h.f());
        q[0] = (EditText)findViewById(0x7f0d0128);
        q[1] = (EditText)findViewById(0x7f0d0129);
        q[2] = (EditText)findViewById(0x7f0d012a);
        q[3] = (EditText)findViewById(0x7f0d012b);
        q[4] = (EditText)findViewById(0x7f0d012c);
        ainputfilter = new InputFilter[1];
        ainputfilter[0] = new android.text.InputFilter.LengthFilter(h.t());
        as = h.v();
        if(as != null)
        {
            for(int j1 = 0; j1 < as.length; j1++)
                q[j1].setText(as[j1]);

        }
        for(int i1 = 0; i1 < q.length; i1++)
        {
            q[i1].setFilters(ainputfilter);
            q[i1].addTextChangedListener(this);
        }

        r = (TextView)findViewById(0x7f0d012e);
        r.setOnClickListener(this);
        s = (TextView)findViewById(0x7f0d012f);
        s.setOnClickListener(this);
        a = false;
    }

    static void b(PRISActivityUserInfoModify prisactivityuserinfomodify)
    {
        prisactivityuserinfomodify.g();
    }

    private int c(String s1)
    {
        int i1 = 0;
        if(!TextUtils.isEmpty(s1)) goto _L2; else goto _L1
_L1:
        return i1;
_L2:
        int j1 = i.length;
        int k1 = i1;
        do
        {
            if(k1 < j1)
            {
label0:
                {
                    if(!i[k1].equals(s1))
                        break label0;
                    i1 = k1;
                }
            }
            if(true)
                continue;
            k1++;
        } while(true);
        if(true) goto _L1; else goto _L3
_L3:
    }

    private void c()
    {
        j = null;
        k = null;
        l = null;
        m = null;
        n = null;
        o = null;
        p = null;
        q[0] = null;
        q[1] = null;
        q[2] = null;
        q[3] = null;
        q[4] = null;
        r = null;
        s = null;
        if(t != null)
        {
            t.recycle();
            t = null;
        }
    }

    static void c(PRISActivityUserInfoModify prisactivityuserinfomodify)
    {
        prisactivityuserinfomodify.e();
    }

    static void d(PRISActivityUserInfoModify prisactivityuserinfomodify)
    {
        prisactivityuserinfomodify.f();
    }

    static UserInfo e(PRISActivityUserInfoModify prisactivityuserinfomodify)
    {
        return prisactivityuserinfomodify.h;
    }

    private void e()
    {
        s();
    }

    static Bitmap f(PRISActivityUserInfoModify prisactivityuserinfomodify)
    {
        return prisactivityuserinfomodify.t;
    }

    private void f()
    {
        startActivityForResult(new Intent("android.intent.action.PICK", android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 3);
    }

    private void g()
    {
        h.h(n.getEditableText().toString());
        h.i(p.getEditableText().toString());
        h.y();
        for(int i1 = 0; i1 < q.length; i1++)
            h.k(q[i1].getEditableText().toString());

        showDialog(0);
        cls_v v1 = com.nnee.p_pr.cls_v.a();
        cls_UserInfo userinfo = h;
        Bitmap bitmap;
        if(f)
            bitmap = t;
        else
            bitmap = null;
        v1.a(userinfo, bitmap, null);
    }

    private void h()
    {
        if(a)
            showDialog(1);
        else
            finish();
    }

    private void r()
    {
        (new android.app.AlertDialog.Builder(this)).setTitle(0x7f0a0128).setItems(getResources().getStringArray(0x7f07000f), new eg(this)).show();
    }

    private void s()
    {
        startActivityForResult(new Intent("android.media.action.IMAGE_CAPTURE"), 2);
    }

    void a(int i1, Intent intent)
    {
        i1;
        JVM INSTR tableswitch -1 0: default 24
    //                   -1 25
    //                   0 24;
           goto _L1 _L2 _L1
_L1:
        return;
_L2:
        Bitmap bitmap = (Bitmap)intent.getExtras().get("data");
        Intent intent1 = new Intent(this, com.nnee.p_img.p_video.cls_ActivityCropImage.class);
        Bundle bundle = new Bundle();
        bundle.putParcelable("data", bitmap);
        intent1.putExtras(bundle);
        startActivityForResult(intent1, 4);
        bitmap.recycle();
        if(true) goto _L1; else goto _L3
_L3:
    }

    void a(String s1)
    {
        cls_ActivityCropImage.b(this, 4, BitmapFactory.decodeFile(s1));
    }

    public void afterTextChanged(Editable editable)
    {
        a = true;
    }

    void b(int i1, Intent intent)
    {
        i1;
        JVM INSTR tableswitch -1 0: default 24
    //                   -1 25
    //                   0 24;
           goto _L1 _L2 _L1
_L1:
        return;
_L2:
        Cursor cursor;
        android.net.Uri uri = intent.getData();
        String as[] = new String[1];
        as[0] = "_data";
        cursor = getContentResolver().query(uri, as, null, null, null);
        if(cursor == null) goto _L4; else goto _L3
_L3:
        if(cursor.moveToFirst())
            cls_ActivityCropImage.b(this, 4, com.nnee.p_pr.p_a.cls_p.a(BitmapFactory.decodeFile(cursor.getString(0)), 256, 256));
_L4:
        if(cursor != null)
            cursor.close();
        if(true) goto _L1; else goto _L5
_L5:
        Exception exception;
        exception;
        if(cursor != null)
            cursor.close();
        throw exception;
    }

    public void beforeTextChanged(CharSequence charsequence, int i1, int j1, int k1)
    {
    }

    void c(int i1, Intent intent)
    {
        i1;
        JVM INSTR tableswitch -1 0: default 24
    //                   -1 25
    //                   0 24;
           goto _L1 _L2 _L1
_L1:
        return;
_L2:
        Bitmap bitmap = (Bitmap)intent.getExtras().getParcelable("data");
        t = bitmap;
        j.setImageBitmap(com.nnee.p_pr.p_a.cls_p.a(bitmap));
        f = true;
        if(true) goto _L1; else goto _L3
_L3:
    }

    protected void onActivityResult(int i1, int j1, Intent intent)
    {
        if(j1 == -1)
            a = true;
        i1;
        JVM INSTR tableswitch 2 4: default 40
    //                   2 41
    //                   3 50
    //                   4 59;
           goto _L1 _L2 _L3 _L4
_L1:
        return;
_L2:
        a(j1, intent);
        continue; /* Loop/switch isn't completed */
_L3:
        b(j1, intent);
        continue; /* Loop/switch isn't completed */
_L4:
        c(j1, intent);
        if(true) goto _L1; else goto _L5
_L5:
    }

    public void onClick(View view)
    {
        view.getId();
        JVM INSTR lookupswitch 4: default 48
    //                   2131558408: 49
    //                   2131558692: 63
    //                   2131558702: 49
    //                   2131558703: 56;
           goto _L1 _L2 _L3 _L2 _L4
_L1:
        return;
_L2:
        g();
        continue; /* Loop/switch isn't completed */
_L4:
        h();
        continue; /* Loop/switch isn't completed */
_L3:
        r();
        if(true) goto _L1; else goto _L5
_L5:
    }

    protected void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        setContentView(0x7f03004f);
        com.nnee.p_pr.cls_v.a().a(w);
        Bundle bundle1 = getIntent().getExtras();
        h = (UserInfo)bundle1.getParcelable("extra_userinfo_value");
        t = (Bitmap)bundle1.getParcelable("data");
        if(h == null)
        {
            finish();
        } else
        {
            i = getResources().getStringArray(0x7f070012);
            b();
        }
    }

    protected Dialog onCreateDialog(int i1)
    {
        i1;
        JVM INSTR tableswitch 0 1: default 24
    //                   0 32
    //                   1 67;
           goto _L1 _L2 _L3
_L1:
        Object obj = super.onCreateDialog(i1);
_L5:
        return ((Dialog) (obj));
_L2:
        obj = new ProgressDialog(this);
        ((ProgressDialog) (obj)).setMessage(getString(0x7f0a0130));
        ((ProgressDialog) (obj)).setOnDismissListener(new ef(this));
        continue; /* Loop/switch isn't completed */
_L3:
        obj = (new android.app.AlertDialog.Builder(this)).setIcon(0x7f02008b).setTitle(0x7f0a0131).setMessage(0x7f0a0132).setPositiveButton(0x7f0a0133, b).setNeutralButton(0x7f0a0135, b).setNegativeButton(0x7f0a0134, b).create();
        if(true) goto _L5; else goto _L4
_L4:
    }

    protected void onDestroy()
    {
        c();
        com.nnee.p_pr.cls_v.a().b(w);
        super.onDestroy();
    }

    public void onItemSelected(AdapterView adapterview, View view, int i1, long l1)
    {
        a = true;
        h.j(com.nnee.p_l.p_a.cls_a.a(this, i[i1]));
    }

    public boolean onKeyDown(int i1, KeyEvent keyevent)
    {
        boolean flag = true;
        if(i1 == 4 && keyevent.getAction() == 0 && a)
            showDialog(flag);
        else
            flag = super.onKeyDown(i1, keyevent);
        return flag;
    }

    public void onNothingSelected(AdapterView adapterview)
    {
    }

    protected void onPause()
    {
        super.onPause();
        o.setOnItemSelectedListener(null);
    }

    protected void onResume()
    {
        super.onResume();
        o.setOnItemSelectedListener(this);
    }

    public void onTextChanged(CharSequence charsequence, int i1, int j1, int k1)
    {
    }

    static final int c = 0;
    static final int d = 1;
    private static final String g = com.nnee.p_pr.p_activity.cls_PRISActivityUserInfoModify.class.getCanonicalName();
    private static final int u = 0;
    private static final int v = 1;
    boolean a;
    android.content.DialogInterface.OnClickListener b;
    Handler e;
    boolean f;
    private cls_UserInfo h;
    private String i[];
    private ImageView j;
    private TextView k;
    private TextView l;
    private TextView m;
    private EditText n;
    private Spinner o;
    private EditText p;
    private EditText q[];
    private TextView r;
    private TextView s;
    private Bitmap t;
    private b w;

}
